package hashSet;

/**
 * 计算哈希值
 */
public class HashSetDemo2 {
    public static void main(String[] args) {
        Student s1 = new Student("xiaozhi", 23);
        Student s2 = new Student("xiaohui", 20);
//        Student s3 = new Student("xiaomian", 25);

        // 在Object类中，哈希值是根据对象的地址值计算出来的
        System.out.println(s2.hashCode()); // 990368553
        System.out.println(s1.hashCode()); // 1096979270
        System.out.println(s1.hashCode()); // 1096979270
    }
}
